/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Felipe
 */
@Entity
@Table (name="usuario")
public class Usuario implements Serializable {

    // Atributes
    @Id
    @SequenceGenerator(name="cd_usuario")
    @GeneratedValue(generator="cd_usuario")
    @Column(name="cd_usuario", length=2, nullable=false)
    private int id;
    
    @Column(name="nm_usuario", length=50, nullable=false)
    private String nome;
    
    @Column(name="nm_login", length=20, nullable=false)
    private String login;
    
    @Column(name="nm_senha", length=15, nullable=false)
    private String senha;
    
    @Column(name="nm_usuario_tipo", length=15, nullable=false)
    private String tipo;
    
    // Constructor full less id
    public Usuario(String nome, String login, String senha, String tipo){
        this.nome = nome;
        this.login = login;
        this.senha = senha;
        this.tipo = tipo;
    }
    
    // Default constructor
    public Usuario() { }

    // Getters and setters
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public String getLogin() { return login; }
    public void setLogin(String login) { this.login = login; }
    public String getNome() { return nome; }
    public void setNome(String nome) { this.nome = nome; }
    public String getSenha() { return senha; }
    public void setSenha(String senha) { this.senha = senha; }
    public String getTipo() { return tipo; }
    public void setTipo(String tipo) { this.tipo = tipo; }
   
}
